package com.czk.ssaa2aagent.config;

import com.alibaba.cloud.ai.graph.agent.BaseAgent;
import com.alibaba.cloud.ai.graph.agent.ReactAgent;
import com.alibaba.cloud.ai.graph.exception.GraphStateException;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * @author chenzhangkun
 * @ClassName A2AAgentConfig
 * @description: TODO
 * @date 2025年11月19日
 */
@Configuration
public class A2AAgentConfig {


    private static final String SYSTEM_PROMPT = """
            你是一个情感助手，专门做情感问题的心理疏导
            """;
    @Bean
    @Primary
    public BaseAgent rootAgent(@Qualifier("qwen") ChatModel chatModel) throws GraphStateException {
        return ReactAgent.builder().name("emotionAgent").description(
                        "情感A2A Agent")
                .model(chatModel).instruction(SYSTEM_PROMPT).outputKey("output").build();
    }
}
